Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/mantine
@blocknote/react
@blocknote/server-util
@blocknote/shadcn
@blocknote/xl-ai
@blocknote/xl-docx-exporter
@blocknote/xl-email-exporter
@blocknote/xl-multi-column
@blocknote/xl-odt-exporter
@blocknote/xl-pdf-exporter
commit: |
nperez0111
reviewed
Oct 27, 2025
packages/core/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts
Outdated
Show resolved
Hide resolved
nperez0111
requested changes
Oct 29, 2025
Contributor
nperez0111
left a comment
There was a problem hiding this comment.
Will hold on this until we get that PR through
nperez0111
reviewed
Feb 24, 2026
Comment on lines
+22
to
+26
| // TODO: This works for blockContainer nodes as we need to traverse 2 | ||
| // nesting levels due to the blockGroup in between. However, that's not the | ||
| // case for columns. | ||
| $pos.index($pos.depth - 2), | ||
| $pos.depth - 2, |
nperez0111
reviewed
Feb 24, 2026
Comment on lines
+96
to
+102
| if ( | ||
| !prevBlockInfo || | ||
| !prevBlockInfo.isBlockContainer || | ||
| prevBlockInfo.blockContent.node.type.spec.content !== "inline*" | ||
| ) { | ||
| return false; | ||
| } |
Contributor
There was a problem hiding this comment.
can we add a todo on why we early return here
nperez0111
reviewed
Feb 24, 2026
Comment on lines
200
to
+201
| tr.setSelection( | ||
| TextSelection.near(tr.doc.resolve($columnPos.pos - 1)), | ||
| TextSelection.near(tr.doc.resolve($columnPos.pos)), |
Contributor
There was a problem hiding this comment.
text selection is after now? Intentional?
nperez0111
reviewed
Feb 24, 2026
Contributor
nperez0111
left a comment
There was a problem hiding this comment.
How do you test the delete key on macOS? I'm unsure how to do it
Comment on lines
+708
to
+725
| if (nextBlockInfo.bnBlock.node.childCount === 2) { | ||
| const childBlocks = | ||
| nextBlockInfo.bnBlock.node.lastChild!.content; | ||
| return chain() | ||
| .deleteRange({ | ||
| from: nextBlockInfo.bnBlock.beforePos, | ||
| to: nextBlockInfo.bnBlock.afterPos, | ||
| }) | ||
| .insertContentAt(blockInfo.bnBlock.afterPos, childBlocks) | ||
| .run(); | ||
| } | ||
|
|
||
| return chain() | ||
| .deleteRange({ | ||
| from: nextBlockInfo.bnBlock.beforePos, | ||
| to: nextBlockInfo.bnBlock.afterPos, | ||
| }) | ||
| .run(); |
Contributor
There was a problem hiding this comment.
These two can be merged right. insetContentAt accepts null no-ops right
Collaborator
Author
I think it's Fn+Backspace but not 100% sure since I use a keyboard with Windows modifiers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds full Delete key handling, building on the existing logic. The additional cases are mainly for nested blocks and multi-column blocks.
R.e. multi-column, Backspace key handling has also been slightly changed to be more consistent. Specifically, whenever a block moves into a column after pressing Backspace or Delete, it now always gets added as a new block. Previously, it would sometimes be merged with the current block.
Rationale
While Delete isn't used as much as Backspace, proper handling for it is still needed.
Changes
columnList.getNextBlockInfohelper.getParentBlockInfohelper.Impact
N/A
Testing
Added e2e tests for Delete key handling:
Screenshots/Video
N/A
Checklist
Additional Notes